import layout from '@/views/layout.vue'
import login from '@/views/login.vue'

import index from '@/views/index.vue'
import dynamicList from '@/views/dynamic/dynamic-list.vue'
import dynamicDetails from '@/views/dynamic/dynamic-details.vue'
import addDynamic from '@/views/dynamic/add-dynamic.vue'
import userList from '@/views/user/user-list.vue'
import userSearchList from '@/views/user/user-search-list.vue'
import myFriendList from '@/views/user/my-friend-list.vue'
import recommendUserList from '@/views/user/recommend-user-list.vue'
import myFansList from '@/views/user/my-fans-list.vue'
import messageList from '@/views/message/message-list.vue'
import leaveMessageList from '@/views/message/leave-message-list.vue'
import myMessageList from '@/views/message/my-message-list.vue'
import commentMessageList from '@/views/message/comment-message-list.vue'
import goodMessageList from '@/views/message/like-message-list.vue'
import newFansMessageList from '@/views/message/new-fans-message-list.vue'
import systemMessageList from '@/views/message/system-message-list.vue'

import myInfo from '@/views/my/my-info.vue'
import userDetails from '@/views/my/user-details.vue'
import uploadHead from '@/views/my/upload-head.vue'
import businessCard from '@/views/my/business-card.vue'
import userTag from '@/views/my/user_tag.vue'
import account from '@/views/my/account.vue'
import updatePassword from '@/views/my/update-password.vue'
import updateEmail from '@/views/my/update-email.vue'
import homeIndex from '@/views/home/home-index.vue'


const routes = [
    {
        path: '/login',
        name: 'login',
        components: {
            default: login
        }
    }, {
        path: '/add-dynamic',
        name: 'add-dynamic',
        components: {
            default: addDynamic
        }
    },
    {
        path: '/',
        name: 'layout',
        redirect: {name: 'index'},
        children: [
            {
                path: '/',
                name: 'index',
                components: {
                    default: index
                }
            },
            {
                path: '/dynamic-list',
                name: 'dynamic-list',
                components: {
                    default: dynamicList
                }
            },
            {
                path: '/dynamic-details',
                name: 'dynamic-details',
                components: {
                    default: dynamicDetails
                }
            },
            {
                path: '/message-list',
                name: 'message-list',
                redirect: {name: 'leave-message-list'},
                components: {
                    default: messageList
                },
                children: [
                    {
                        path: '/leave-message-list',
                        name: 'leave-message-list',
                        components: {
                            default: leaveMessageList
                        }
                    }, {
                        path: '/my-message-list',
                        name: 'my-message-list',
                        components: {
                            default: myMessageList
                        }
                    },
                    {
                        path: '/comment-message-list',
                        name: 'comment-message-list',
                        components: {
                            default: commentMessageList
                        }
                    },
                    {
                        path: '/like-message-list',
                        name: 'like-message-list',
                        components: {
                            default: goodMessageList
                        }
                    },
                    {
                        path: '/new-fans-message-list',
                        name: 'new-fans-message-list',
                        components: {
                            default: newFansMessageList
                        }
                    },
                    {
                        path: '/system-message-list',
                        name: 'system-message-list',
                        components: {
                            default: systemMessageList
                        }
                    }
                ]
            },
            {
                path: '/user-list',
                name: 'user-list',
                redirect: {name: 'user-search-list'},
                components: {
                    default: userList
                },
                children: [
                    {
                        path: '/user-search-list',
                        name: 'user-search-list',
                        components: {
                            default: userSearchList
                        }
                    },
                    {
                        path: '/my-friend-list',
                        name: 'my-friend-list',
                        components: {
                            default: myFriendList
                        }
                    },
                    {
                        path: '/recommend-user-list',
                        name: 'recommend-user-list',
                        components: {
                            default: recommendUserList
                        }
                    },
                    {
                        path: '/my-fans-list',
                        name: 'my-fans-list',
                        components: {
                            default: myFansList
                        }
                    }
                ]
            },
            {
                path: '/my-info',
                name: 'myInfo',
                redirect: {name: 'user-details'},
                components: {
                    default: myInfo
                },
                children: [
                    {
                        path: '/user-details',
                        name: 'user-details',
                        components: {
                            default: userDetails
                        }
                    },
                    {
                        path: '/upload-head',
                        name: 'upload-head',
                        components: {
                            default: uploadHead
                        }
                    },
                    {
                        path: '/business-card',
                        name: 'business-card',
                        components: {
                            default: businessCard
                        }
                    },
                    {
                        path: '/user-tag',
                        name: 'user-tag',
                        components: {
                            default: userTag
                        }
                    },
                    {
                        path: '/account',
                        name: 'account',
                        components: {
                            default: account
                        }
                    },
                    {
                        path: '/update-password',
                        name: 'update-password',
                        components: {
                            default: updatePassword
                        }
                    },
                    {
                        path: '/update-email',
                        name: 'update-email',
                        components: {
                            default: updateEmail
                        }
                    }
                ]
            },
            {
                path: '/home',
                name: 'home',
                components: {
                    default: homeIndex
                }
            }
        ],
        components: {
            default: layout
        }
    }
]

export default routes;